package com.lb.bs.client.processor.enums;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

/**
 * program: LB-BS-Client
 * author: bsworld.xie
 * create: 2019-12-10 17:30
 * description:
 */
public enum ProcessorType {
    CREATE(1, "创建"),
    UPDATE(2, "更新"),
    REMOVE(3, "移除"),
    FIRST_TO_ITEM_BEAN(11, "向itemBean转换"),
    FIRST_TO_INSTANCE(12, "向实体转换"),
    SECOND_SYNC_UPDATE_CALL_BACK(13, "向store center 同步更新配置信息"),
    SECOND_INIT_GRAY_INIT(14, "初始化zk相关信息"),
    THIRD_WATCH_REMOTE_RELOAD(15, "监听远程zookeeper"),
    ;


    ProcessorType(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }


    private static Map<Integer, ProcessorType> lookUpMap = new HashMap<>();

    static {
        EnumSet<ProcessorType> processorTypes = EnumSet.allOf(ProcessorType.class);
        for (ProcessorType processorType : processorTypes) {
            lookUpMap.put(processorType.getCode(), processorType);
        }
    }

    private Integer code;
    private String msg;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public static void main(String[] args) {
        System.out.println(1 << 16 + 1);
        System.out.println(2 << 16 + 1);
        System.out.println(3 << 16 + 1);
        System.out.println(4 << 16 + 1);
        int a = 1 << 16 + 1;
        int i = a >> 16;
        System.out.println(i);
    }
}
